#ifndef _EMOTIONINTERFACE_H_
#define _EMOTIONINTERFACE_H_

#include <QWidget>
#include <QTimer>
#include <QHash>

#include "qcustomplot.h"


class EmotionInterface : public QObject
{
    Q_OBJECT
public:
    enum EmoMode{
        // error = 0,
        Negative = -1,
        Neutral = 0,
        Positive = 1,
        Free = 2
        // Rest = 3
    };
    Q_ENUM(EmoMode)

    EmoMode &currentEmotion;
    EmoMode &videoEmotion;

private:
    // y轴情绪标签
    QLabel *y_negLabel;
    QLabel *y_neuLabel;
    QLabel *y_posLabel;
    // 动态情绪标签
    QLabel *emo_negLabel;
    QLabel *emo_neuLabel;
    QLabel *emo_posLabel;
    QMovie *emo_gif;

    // 情绪曲线
    QCustomPlot *emo_plot;
    QTimer timer_emoPlot;   
    // bool  m_start_emoPlot;
    
    EmoMode current_emotion;
    EmoMode video_emotion;
    
public:
    // explicit EmotionInterface(QLabel *emo_label, QCustomPlot *emo_plot);
    // explicit EmotionInterface(QLabel *emo_negLabel, QLabel *emo_neuLabel, QLabel *emo_posLabel, QCustomPlot *emo_plot);
    explicit EmotionInterface(const QHash<QString, QLabel*> &uiLabelHash, QCustomPlot *emo_plot);

    ~EmotionInterface();
    
    void emotionImageInit();
    void emotionGIFInit();
    void emotionPlotInit();
    void setGraph_visible(int graphID, bool flag);
    void set_emoGIF();
    void startPlot(const int &arg=0);
    void stopPlot(const int &arg=0);
    void clearPlot(const int &arg=0);

    void hideEmoGIF();



    // void realtimeDataSlot();

public slots:
    // 刷新波形显示
    void realtimeDataSlot();
    void setCurrent_emotion(EmoMode mode);
    void setVideo_emotion(EmoMode mode);


};





#endif // !_EMOTIONINTERFACE_H_
